package com.ws.mapper;

import com.ws.bean.Routes;
import com.ws.bean.vo.RouteVo;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface RouteMapper {

    List<Routes> list( RouteVo routeVo);

    int add(Routes routes);

    int delete(Integer routeId);

    Routes getRouteById(Integer routeId);

    int update(Routes routes);

    List<Routes> getCategorieList(Integer categorieId);

    @Update("update routes set collection_num=collection_num+1 where route_id=#{routeId}")
    int updateFavoriteNum(Integer routeId);

    @Update("update routes set collection_num=collection_num-1 where route_id=#{routeId}")
    int updateFavoriteDeleteNum(Integer routeId);

    @Update("update routes set is_delete = 1 where route_id=#{routeId}")
    int updateDele(Integer routeId);

    @Select("select count(*) from routes where supplier_id=#{id}")
    int selectRouteBySupplierId(Integer id);

    List<Routes> list2(RouteVo routeVo);
}
